<?php

include_once "header.php";

echo "<div class='container'>
<div class='row'>";
include_once "sidebar.php";

echo "<div class='span9'>";
echo "<a href='addtestimoni.php' class='btn btn-primary'>Tambah Testimoni</a></div><div>";
 
require_once "../dao/testimoni_dao.php";

$modul=$_GET['modul'];
$id=$_GET['id'];
$breadcrump ="";

$testimoni = new Testimoni_Dao($class_db);
include "../../config/paging.php";
$p = new Paging;

switch($modul){
    
    default :
                
        $batas = 10;
        $posisi = $p->cari_posisi($batas);
        		
		$testimoni->db->show_Data("testimoni","*",$posisi,$batas);
        
        $jmldata = count($testimoni->hasil);
        
        $testimonii = $testimoni->db->hasil;
        
        //var_dump($testimonii);
        
        if($testimonii!=null) {
            
           foreach($testimonii as $data) {            
            
            $tanggal = new Tanggal($data['date']);
            
            $tgl = $tanggal->get_tgl_indo();
			
			$content = $testimoni->list_content($data['content'],$data['testi_id']);
            
            echo "
            
            <div class='span8 well pull-left'><table>                
                ";
            
            echo "
                <tr valign = top>
                    <td colspan=9 style='color:blue;font-weight:bold'>$data[title]</td></tr>
                    <tr valign = top><td colspan=9><img src='../../images/clock.gif'> $tgl | Kontributor : $data[reviewer]</td></tr>
                    <tr valign = top><td colspan=9>Rating : $data[rating]</td></tr>
                    <td colspan=9>$content</td></tr>
                                        
                ";
                
            echo "            
            </table></div><div></div>
            ";        
            
            } 
			
			echo "<div class=span8>";
			
			$testimoni->db->hasil = "";
			$testimoni->db->show_Data('testimoni');
			$jml_data = count($testimoni->db->hasil);
			$jml_halaman = $p->jml_halaman($jml_data, $batas);
			
			$link_halaman = $p->navHalaman(null, $_GET['halaman'],$jml_halaman);
            
            echo $link_halaman;
            
            echo "</div>"; 
        }else{
            echo "<tr><td colspan=5 align=center>DATA TIDAK DITEMUKAN</td></tr>";
        }
		
    break;    
    
    
    
    
}

echo "</div>";
echo "</div>";
echo "</div>";

include_once "footer.php";
?>